Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Movie Functions


CreateMovieFile

The CreateMovieFile function creates an open movie file, opens the movie file, creates an empty movie which references the file, and opens the movie file with write permission.

pascal OSErr CreateMovieFile (const FSSpec *fileSpec, 
                              OSType creator, 
                              ScriptCode scriptTag, 
                              long createMovieFileFlags, 
                              short *resRefNum, 
                              Movie *newMovie);
fileSpec
Contains a pointer to the file system specification for the movie file to be created.
creator
Specifies the creator value for the new file.
scriptTag
Specifies the script in which the movie file should be created. Use the Script Manager constant smSystemScript to use the system script; use the smCurrentScript constant to use the current script. See Inside Macintosh: Text for more information about scripts and script tags.
createMovieFileFlags
Controls movie-file creation flags. The following flags are available:
createMovieFileDeleteCurFile
Indicates whether to delete an existing file. If you set this flag to 1, the Movie Toolbox deletes the file (if it exists) before creating the new movie file. If you set this flag to 0 and the file specified by the fileSpec parameter already exists, the Movie Toolbox uses the existing file. In this case, the toolbox ensures that the file has both a data and a resource fork.
createMovieFileDontCreateMovie
Controls whether the CreateMovieFile function creates a new movie in the movie file. If you set this flag to 1, the Movie Toolbox does not create a movie in the new movie file. In this case, the function ignores the newMovie parameter. If you set this flag to 0, the Movie Toolbox creates a movie and returns the movie identifier in the field referred to by the newMovie parameter.
createMovieFileDontOpenFile

Controls whether the CreateMovieFile function opens the new movie file. If you set this flag to 1, the Movie Toolbox does not open the new movie file. In this case, the function ignores the resRefNum parameter. If you set this flag to 0, the Movie Toolbox opens the new movie file and returns its reference number into the field referred to by the resRefNum parameter.
newMovieActive
Controls whether the new movie is active. Set this flag to 1 to make the new movie active. A movie that does not have any tracks can still be active. When the Movie Toolbox tries to play the movie, no images are displayed, because there is no movie data. You can make a movie active or inactive by calling the SetMovieActive function, which is described on page 2-131.
newMovieDontAutoAlternate
Controls whether the Movie Toolbox automatically selects enabled tracks from alternate track groups. If you set this flag to 1, the Movie Toolbox does not automatically select tracks for the movie--you must enable tracks yourself.
resRefNum
Contains a pointer to a field that is to receive the file reference number for the opened movie file. Your application must use this value when calling other Movie Toolbox functions that work with movie files. If you set this parameter to nil, the Movie Toolbox creates the movie file but does not open the file.
newMovie
Contains a pointer to a field that is to receive the identifier of the new movie. The CreateMovieFile function returns the identifier of the new movie. If the function could not create a new movie, it sets this returned value to nil. If you set this parameter to nil, the Movie Toolbox does not create a movie.
ERROR CODES
movieToolboxUninitialized-2020You haven't initialized the Movie Toolbox
File Manager errors
Memory Manager errors

SEE ALSO
You can delete a movie file by calling the DeleteMovieFile function, which is described on page 2-87.

Your application can use the functions described in "Creating Tracks and Media Structures," which begins on page 2-136, to place movie data into the new movie file.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996